﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;

using FingerPrint.WebUI.Abstract;
//using FingerPrint.WebUI.Concrete;
using FingerPrint.WebUI.Models;
using FingerPrint.WebUI.ViewModels;
using FingerPrint.WebUI.DAL;
using Kendo.Mvc.UI;
using Kendo.Mvc.Extensions;


namespace FingerPrint.WebUI.Controllers
{
    public class EmployeeController : Controller
    {
        private FingerPrintContext db = new FingerPrintContext();

        private UnitOfWork unitOfWork = new UnitOfWork();


        //
        // GET: /Employee/

        public ActionResult Index()
        {
            return View();
        }


        //
        // GET: /Product/Details/5

        public ActionResult Details(int id)
        {
            return View();
        }

        //
        // GET: /Product/Create

        public ActionResult Create()
        {
            return View();
        }

        //
        // POST: /Product/Create

        [HttpPost]
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Product/Edit/5

        public ActionResult Edit(int id)
        {
            return View();
        }

        //
        // POST: /Product/Edit/5

        [HttpPost]
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add update logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }

        //
        // GET: /Product/Delete/5

        public ActionResult Delete(int id)
        {
            return View();
        }

        //
        // POST: /Product/Delete/5

        [HttpPost]
        public ActionResult Delete(int id, FormCollection collection)
        {
            try
            {
                // TODO: Add delete logic here

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }


//---- Methods ----------------------------------------------------

        //public JsonResult GetAllEmployees()
        //{
           
        //    var employees = unitOfWork.EmployeeRepository
        //        .Get()
        //        .Select(em => new Employee
        //            {
        //                EmployeeID = em.EmployeeID,
        //                EngName = em.EngName
        //            })
        //         .OrderBy(em => em.EngName.ToString());

        //    return Json(employees, JsonRequestBehavior.AllowGet);
        //}

    }
}
